﻿
    using Chain.BLL;
    using Chain.Model;
    using System;
    using System.Data;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public partial class MicroGoodsInfo : PageBase
    {


        public void BindMicroGoodsClass(HtmlSelect select, int ShopID)
        {
            select.Items.Clear();
            select.Items.Add(new ListItem("===== 请选择 =====", ""));
            DataTable dtGoodsClass = new Chain.BLL.MicroWebsiteGoodsClass().GetList(string.Format("MicroGoodsClassShopID={0}", ShopID)).Tables[0];
            foreach (DataRow dr in dtGoodsClass.Rows)
            {
                select.Items.Add(new ListItem(dr["MicroGoodsClassName"].ToString(), dr["MicroGoodsClassID"].ToString()));
            }
        }

        protected void GetGoodsInfo(int goodsID)
        {
            
            //this.txtGoodsID.Value = goodsID.ToString();
            //this.imgGoodsPhoto.Src = modelGoods.GoodsSlideshow_img;
            Chain.BLL.GoodsSlideshow bllGoods = new Chain.BLL.GoodsSlideshow();
            
            DataTable dtGoods = bllGoods.GetList(" GoodsID=" + goodsID).Tables[0];
            this.gvGoodsSlideshowList.DataSource = dtGoods;
            this.gvGoodsSlideshowList.DataBind();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                if (base.Request.QueryString["GoodsID"] != null)
                {

                    this.GetGoodsInfo(int.Parse(base.Request.QueryString["GoodsID"]));
                }
                else
                {
                    //this.BindMicroGoodsClass(this.sltGoodsClass, 1);
                }
            }
        }
    }


